<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition template="/HomeTemplate.xhtml"
                xmlns="http://www.w3.org/1999/xhtml"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:p="http://primefaces.org/ui"
                >
    <ui:define name="body">
        <div class="main-container" >
            <p:tabMenu id="tab1" model="#{dynamicMenu.getSimpleMenuModel(3)}" style="width: 90%"  />
            <h:form id="form" style="width: 90%" > 
                <p:panel header="Warranty Information" style="width: 90%; border-bottom: none">
                    <h:panelGrid columns="6" columnClasses="column" cellpadding="10">  
                        <h:outputText value="Model Year:" />
                        <p:selectOneMenu value="#{claimBean.catalogBean.param}" id="year" style="margin-right: 20px;" >
                            <f:selectItem itemLabel="Select" itemValue="" />
                            <f:selectItems value="#{yearBean.years}" var="year"
                                           itemLabel="#{year.idYear}" itemValue="#{year.idYear}"/>
                            <p:ajax update="name" listener="#{catalogBean.handleCatalogChange('InCatalog.findByModelYear', 'modelYear')}" ></p:ajax> 
                        </p:selectOneMenu>
                        <h:outputText value="Model Name: " />
                        <p:selectOneMenu value="#{claimBean.modelName}" id="name"  >
                            <f:selectItem itemLabel="Select Ride" itemValue="" />
                            <f:selectItems value="#{claimBean.catalogBean.catalogs}" var="catalog"
                                           itemLabel="#{catalog.modelName}" itemValue="#{catalog.modelName}"/>
                        </p:selectOneMenu>
                        <h:outputText value="Claim Item:" />
                        <p:selectOneMenu value="#{claimBean.claimItem}" id="claimItem"  >
                            <f:selectItem itemLabel="Select Claim Item" itemValue="" />
                            <f:selectItems value="#{claimItemBean.claimItemsNoGears}" var="claimItem"
                                           itemLabel="#{claimItem.description}" itemValue="#{claimItem.idClaimItem}"/>
                        </p:selectOneMenu>
                        <h:outputText value="Frame No:" />
                        <p:inputText value="#{claimBean.temp.frameNo}" /> 
                        <h:outputText value="Frame Size: " />
                        <p:inputText value="#{claimBean.temp.frameSize}" /> 

                        <h:outputText value="Claim Description: " />
                        <p:inputText value="#{claimBean.temp.claimDescription}" /> 
                        <h:outputText value="Frame Photo: " />
                        <h:form id="form1" enctype="multipart/form-data">  

                            <p:fileUpload id="file1" widgetVar="file1" fileUploadListener="#{claimBean.handleFileUpload}" 
                                          multiple="true"
                                          mode="advanced"   
                                          update="messages"  
                                          sizeLimit="600000"   
                                          allowTypes="/(\.|\/)(gif|jpe?g|png)$/"
                                          />  
                            <p:growl id="messages" showDetail="true"/> 

                        </h:form>
                        <h:outputText value="Claim Photo: " />
                         <h:form id="form2" enctype="multipart/form-data">  

                             <p:fileUpload id="file2" widgetVar="file2" fileUploadListener="#{claimBean.handleFileUpload2}" 
                                          multiple="true"
                                          mode="advanced"   
                                          update="messages2"  
                                          sizeLimit="600000"   
                                          allowTypes="/(\.|\/)(gif|jpe?g|png)$/"
                                          />  

                            <p:growl id="messages2" showDetail="true"/>  

                        </h:form>
                        
                      
                    </h:panelGrid>

                </p:panel>
                <p:panel header="Consumer Information" style="width: 90%; border-top: none">
                    <h:panelGrid columns="4" columnClasses="column" cellpadding="10">  
                        <h:outputText value="Height (cm):" />
                        <p:inputText value="#{claimBean.temp.height}" /> 
                        <h:outputText value="Weight (kg): " />
                        <p:inputText value="#{claimBean.temp.weight}" /> 
                        <h:outputText value="Situation Description: " />
                        <p:inputText value="#{claimBean.temp.situationDesc}"  style="height: 100px; width: 500px"/> 
                    </h:panelGrid>
                </p:panel>
                <h:panelGrid columns="2" cellpadding="5" style="border-bottom-width: 30px">  
                    <p:commandButton  value="Clear" icon="pdf" > </p:commandButton> 
                    <p:commandButton  value="Submit" icon="excel" action="#{claimBean.createClaimFrame()}"  ajax="false" > </p:commandButton>
                </h:panelGrid>
            </h:form>         
        </div>    
    </ui:define>
</ui:composition>



